package com.wuad.platformwuad.component.rabbitMq2;

import lombok.extern.slf4j.Slf4j;
//import org.springframework.amqp.core.Message;
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
//import org.springframework.amqp.support.AmqpHeaders;
//import org.springframework.messaging.handler.annotation.Headers;
import org.springframework.stereotype.Component;
//import com.rabbitmq.client.Channel;

import java.io.IOException;
import java.util.Map;

/**
 * 配置消费者
 *
 * @author ：Wuad
 * @date ：Created in 2021/7/13 16:28
 * @description :
 */
@Slf4j
@Component
public class OrderFailureListener {

//    @RabbitListener(
//            queues = RabbitMQConfiguration.dealQueueOrder //设置订单失效的队列
//    )
//    public void process(String order, Message message, @Headers Map<String, Object> headers, Channel channel) throws IOException {
//
//        log.info("【订单号】 - [{}]",  order);
//        // 判断订单是否已经支付，如果支付则；否则，取消订单（逻辑代码省略)
//        // 手动ack
//        Long deliveryTag = (Long) headers.get(AmqpHeaders.DELIVERY_TAG);
//        // 手动签收
//        channel.basicAck(deliveryTag, false);
//        System.out.println("执行结束....");
//
//    }
}
